.panel.panel-default
  .panel-heading
    .panel-title
      .html_title = @html_title||'用户列表'
      .pull-right
        = link_to_dialog '新增', new_base_user_path, class: 'btn btn-xs btn-primary', style: "color: white"
  .panel-body
    = paginate_full @base_users
    table.table.table-bordered
      thead
        tr
          th 姓名
          th 部门
          th 性别
          th 用户名
          th 邮箱
          th 手机
          th 上次登录时间
          th 操作

      tbody
        - @base_users.each do |base_user|
          tr
            td
              = link_to_dialog base_user.name_cn, base_user
              = '(离职)' unless base_user.active
            td = base_user.department
            td = base_user.gender_text
            td = link_to_dialog base_user.username, base_user
            td = base_user.email
            td = base_user.mobile
            td = base_user.last_login_at.label
            td
              = link_to_dialog '编辑', edit_base_user_path(base_user), class: 'btn btn-xs btn-primary push-5-l'
              - if base_user.active?
                = link_to '设置离职', base_user, data: { confirm: '确定操作?' },
                      method: :delete, remote: true, class: 'btn btn-xs btn-danger push-5-l'


